<?php
/**
 *Category Template: Webshop template
 */
get_header();
get_template_part( 'slider2' );

$categoryId = 6;
$categories = get_category( $categoryId );
?>
<div class="container">
	<?php 		
		require_once('header.php'); 		
	?>
	<div class="webshop-header clear-fix">
		<div class="webshop-info">
			<h1><?php echo $categories->name;?></h1>
			<p><?php echo $categories->description;?></p>
		</div>
		<div class="webshop-img">
			<?php 
				$option = '_category_image' . $categoryId;
				$image = get_option($option);			
			?>
			<img src="<?php echo $image; ?>" alt="" width="270" height="210"/>
		</div>
		<a id="btnWebshop-contact" href="?page_id=20">Contact</a>
	</div>
	
	<div class="content">
		<div class="template clear-fix" id="webshop-list-item">
			<?php
				$posts = get_posts(array('category' => 6, 'numberposts' => ''));	
				
				foreach ( $posts as $key=>$value ){										
			?>
			<div class="eachProduct <?php echo ($key%4 == 3) ? 'eachProduct-right' : '';  ?>">
				<h2><a href="?p=<?php echo $value->ID; ?>"><?php echo $value->post_title;?></a></h2>
				<p><?php echo substr($value->post_content,0,167);?></p>
				<?php
					if (has_post_thumbnail( $value->ID )){
						$image = wp_get_attachment_image_src( get_post_thumbnail_id( $value->ID ), 'single-post-thumbnail' );						
						echo '<a href="?p='.$value->ID.'" class="product-image"><img class="imgTemp" src="'.$image[0].'" alt="" width="205" height="105" border="0" /></a>';
					} 
				?>
			</div>
			<?php } ?>
		</div>
	</div>
	<?php require_once('footer.php'); ?>
	
</div>
<?php get_footer(); ?>
